home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / emacs-complete / fsf / emacs / info / emacs-7 < prev    next >
Encoding:
GNU Info File  |  1994-10-06  |  47.1 KB  |  1,137 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.54 from the
  2. input file emacs.texi.
  3.  
  4. 
  5. File: emacs,  Node: Variables for Check-in/out,  Next: Log Entries,  Prev: Editing with VC,  Up: Version Control
  6.  
  7. Variables Affecting Check-in and Check-out
  8. ------------------------------------------
  9.  
  10.    If `vc-suppress-confirm' is non-`nil', then `C-x C-q' and `C-x v i'
  11. can save the current buffer without asking, and `C-x v u' also operates
  12. without asking for confirmation.  (This variable does not affect `C-x v
  13. c'; that is so drastic that it should always ask for confirmation.)
  14.  
  15.    VC mode does much of its work by running the shell commands for RCS
  16. and SCCS.  If `vc-command-messages' is non-`nil', VC displays messages
  17. to indicate which shell commands it runs, and additional messages when
  18. the commands finish.
  19.  
  20.    Normally, VC assumes that it can deduce the locked/unlocked state of
  21. files by looking at the file permissions of the work file; this is
  22. fast.  However, if the `RCS' or `SCCS' subdirectory is actually a
  23. symbolic link, then VC does not trust the file permissions to reflect
  24. this status.
  25.  
  26.    You can specify the criterion for whether to trust the file
  27. permissions by setting the variable `vc-mistrust-permissions'.  Its
  28. value may be `t' (always mistrust the file permissions and check the
  29. master file), `nil' (always trust the file permissions), or a function
  30. of one argument which makes the decision.  The argument is the directory
  31. name of the `RCS' or `SCCS' subdirectory.  A non-`nil' value from the
  32. function says to mistrust the file permissions.  If you find that the
  33. file permissions of work files are changed erroneously, set
  34. `vc-mistrust-permissions' to `t'.  Then VC always checks the master
  35. file to determine the file's status.
  36.  
  37.    You can specify additional directories to search for version control
  38. programs by setting the variable `vc-path'.  These directories are
  39. searched before the usual search path.  But the proper files are usually
  40. found automatically.
  41.  
  42. 
  43. File: emacs,  Node: Log Entries,  Next: Change Logs and VC,  Prev: Variables for Check-in/out,  Up: Version Control
  44.  
  45. Log Entries
  46. -----------
  47.  
  48.    When you're editing an initial comment or log entry for inclusion in
  49. a master file, finish your entry by typing `C-c C-c'.
  50.  
  51. `C-c C-c'
  52.      Finish the comment edit normally (`vc-finish-logentry').  This
  53.      finishes check-in.
  54.  
  55.    To abort check-in, just *don't* type `C-c C-c' in that buffer.  You
  56. can switch buffers and do other editing.  As long as you don't try to
  57. check in another file, the entry you were editing remains in its
  58. buffer, and you can go back to that buffer at any time to complete the
  59. check-in.
  60.  
  61.    If you change several source files for the same reason, it is often
  62. convenient to specify the same log entry for many of the files.  To do
  63. this, use the history of previous log entries.  The commands `M-n',
  64. `M-p', `M-s' and `M-r' for doing this work just like the minibuffer
  65. history commands (except that these versions are used outside the
  66. minibuffer).
  67.  
  68.    Each time you check in a file, the log entry buffer is put into VC
  69. Log mode, which involves running two hooks: `text-mode-hook' and
  70. `vc-log-mode-hook'.  *Note Hooks::.
  71.  
  72. 
  73. File: emacs,  Node: Change Logs and VC,  Next: Old Versions,  Prev: Log Entries,  Up: Version Control
  74.  
  75. Change Logs and VC
  76. ------------------
  77.  
  78.    If you use RCS for a program and also maintain a change log file for
  79. it (*note Change Log::.), you can generate change log entries
  80. automatically from the version control log entries:
  81.  
  82. `C-x v a'
  83.      Visit the current directory's change log file and create new
  84.      entries for versions checked in since the most recent entry in the
  85.      change log file (`vc-update-change-log').
  86.  
  87.      This command works with RCS only; it does not work with SCCS.
  88.  
  89.    For example, suppose the first line of `ChangeLog' is dated 10 April
  90. 1992, and that the only check-in since then was by Nathaniel Bowditch
  91. to `rcs2log' on 8 May 1992 with log text `Ignore log messages that
  92. start with `#'.'.  Then `C-x v a' visits `ChangeLog' and inserts text
  93. like this:
  94.  
  95.      Fri May  8 21:45:00 1992  Nathaniel Bowditch  <nat@apn.org>
  96.      
  97.              * rcs2log: Ignore log messages that start with `#'.
  98.  
  99. You can then edit the new change log entry further as you wish.
  100.  
  101.    Normally, the log entry for file `foo' is displayed as `* foo: TEXT
  102. OF LOG ENTRY'.  The `:' after `foo' is omitted if the text of the log
  103. entry starts with `(FUNCTIONNAME): '.  For example, if the log entry
  104. for `vc.el' is `(vc-do-command): Check call-process status.', then the
  105. text in `ChangeLog' looks like this:
  106.  
  107.      Wed May  6 10:53:00 1992  Nathaniel Bowditch  <nat@apn.org>
  108.      
  109.              * vc.el (vc-do-command): Check call-process status.
  110.  
  111.    When `C-x v a' adds several change log entries at once, it groups
  112. related log entries together if they all are checked in by the same
  113. author at nearly the same time.  If the log entries for several such
  114. files all have the same text, it coalesces them into a single entry.
  115. For example, suppose the most recent checkins have the following log
  116. entries:
  117.  
  118. * For `vc.texinfo': `Fix expansion typos.'
  119. * For `vc.el': `Don't call expand-file-name.'
  120. * For `vc-hooks.el': `Don't call expand-file-name.'
  121.  
  122. They appear like this in `ChangeLog':
  123.  
  124.      Wed Apr  1 08:57:59 1992  Nathaniel Bowditch  <nat@apn.org>
  125.      
  126.              * vc.texinfo: Fix expansion typos.
  127.      
  128.              * vc.el, vc-hooks.el: Don't call expand-file-name.
  129.  
  130.    Normally, `C-x v a' separates log entries by a blank line, but you
  131. can mark several related log entries to be clumped together (without an
  132. intervening blank line) by starting the text of each related log entry
  133. with a label of the form `{CLUMPNAME} '.  The label itself is not
  134. copied to `ChangeLog'.  For example, suppose the log entries are:
  135.  
  136. * For `vc.texinfo': `{expand} Fix expansion typos.'
  137. * For `vc.el': `{expand} Don't call expand-file-name.'
  138. * For `vc-hooks.el': `{expand} Don't call expand-file-name.'
  139.  
  140. Then the text in `ChangeLog' looks like this:
  141.  
  142.      Wed Apr  1 08:57:59 1992  Nathaniel Bowditch  <nat@apn.org>
  143.      
  144.              * vc.texinfo: Fix expansion typos.
  145.              * vc.el, vc-hooks.el: Don't call expand-file-name.
  146.  
  147.    A log entry whose text begins with `#' is not copied to `ChangeLog'.
  148. For example, if you merely fix some misspellings in comments, you can
  149. log the change with an entry beginning with `#' to avoid putting such
  150. trivia into `ChangeLog'.
  151.  
  152. 
  153. File: emacs,  Node: Old Versions,  Next: VC Status,  Prev: Change Logs and VC,  Up: Version Control
  154.  
  155. Examining And Comparing Old Versions
  156. ------------------------------------
  157.  
  158. `C-x v ~ VERSION RET'
  159.      Examine version VERSION of the visited file, in a buffer of its
  160.      own (`vc-version-other-window').
  161.  
  162. `C-x v ='
  163.      Compare the current buffer contents with the latest checked-in
  164.      version of the file.
  165.  
  166. `C-u C-x v = FILE RET OLDVERS RET NEWVERS RET'
  167.      Compare the specified two versions of FILE.
  168.  
  169.    You can examine any version of a file by first visiting it, and then
  170. using `C-x v ~ VERSION RET' (`vc-version-other-window').  This puts the
  171. text of version VERSION in a file named `FILENAME.~VERSION~', then
  172. visits it in a separate window.
  173.  
  174.    To compare two versions of a file, use the command `C-x v ='
  175. (`vc-diff').  Plain `C-x v =' compares the current buffer contents
  176. (saving them in the file if necessary) with the last checked-in version
  177. of the file.  `C-u C-x v =', with a numeric argument, reads a file name
  178. and two version numbers, then compares those versions of the specified
  179. file.
  180.  
  181.    If you supply a directory name instead of the name of a work file,
  182. this command compares the two specified versions of all registered files
  183. in that directory and its subdirectories.  You can also specify a
  184. snapshot name (*note Snapshots::.) instead of one or both version
  185. numbers.
  186.  
  187.    You can specify a checked-in version by its number; an empty input
  188. specifies the current contents of the work file (which may be different
  189. from all the checked-in versions).
  190.  
  191.    This command works by running the `diff' utility, getting the
  192. options from the variable `diff-switches'.  It displays the output in a
  193. special buffer in another window.  Unlike the `M-x diff' command, `C-x
  194. v =' does not try to find the changes in the old and new versions.
  195. This is because one or both versions normally do not exist as files.
  196. They exist only in the records of the master file.  *Note Comparing
  197. Files::, for more information about `M-x diff'.
  198.  
  199. 
  200. File: emacs,  Node: VC Status,  Next: Renaming and VC,  Prev: Old Versions,  Up: Version Control
  201.  
  202. VC Status Commands
  203. ------------------
  204.  
  205.    To view the detailed version control status and history of a file,
  206. type `C-x v l' (`vc-print-log').  It displays the history of changes to
  207. the current file, including the text of the log entries.  The output
  208. appears in a separate window.
  209.  
  210.    When you are working on a large program, it's often useful to find
  211. all the files that are currently locked, or all the files maintained in
  212. version control at all.  You can use `C-x v d' (`vc-directory') to show
  213. all the locked files in or beneath the current directory.  This
  214. includes all files that are locked by any user.  `C-u C-x v d' lists
  215. all files in or beneath the current directory that are maintained with
  216. version control.
  217.  
  218.    The list of files is displayed as a buffer that uses an augmented
  219. Dired mode.  The names of the users locking various files are shown (in
  220. parentheses) in place of the owner and group.  All the normal Dired
  221. commands work in this buffer.  Most interactive VC commands work also,
  222. and apply to the file name on the current line.
  223.  
  224.    The `C-x v v' command (`vc-next-action'), when used in the augmented
  225. Dired buffer, operates on all the marked files (or the file on the
  226. current line).  If it operates on more than one file, it handles each
  227. file according to its current state; thus, it may check out one file
  228. and check in another (because it is already checked out).  If it has to
  229. check in any files, it reads a single log entry, then uses that text
  230. for all the files being checked in.  This can be convenient for
  231. registering or checking in several files at once, as part of the same
  232. change.
  233.  
  234. 
  235. File: emacs,  Node: Renaming and VC,  Next: Snapshots,  Prev: VC Status,  Up: Version Control
  236.  
  237. Renaming VC Work Files and Master Files
  238. ---------------------------------------
  239.  
  240.    When you rename a registered file, you must also rename its master
  241. file correspondingly to get proper results.  Use `vc-rename-file' to
  242. rename the source file as you specify, and rename its master file
  243. accordingly.  It also updates any snapshots (*note Snapshots::.) that
  244. mention the file, so that they use the new name; despite this, the
  245. snapshot thus modified may not completely work (*note Snapshot
  246. Caveats::.).
  247.  
  248.    You cannot use `vc-rename-file' on a file that is locked by someone
  249. else.
  250.  
  251. 
  252. File: emacs,  Node: Snapshots,  Next: Version Headers,  Prev: Renaming and VC,  Up: Version Control
  253.  
  254. Snapshots
  255. ---------
  256.  
  257.    A "snapshot" is a named set of file versions (one for each
  258. registered file) that you can treat as a unit.  One important kind of
  259. snapshot is a "release", a (theoretically) stable version of the system
  260. that is ready for distribution to users.
  261.  
  262. * Menu:
  263.  
  264. * Making Snapshots::        The snapshot facilities.
  265. * Snapshot Caveats::        Things to be careful of when using snapshots.
  266.  
  267. 
  268. File: emacs,  Node: Making Snapshots,  Next: Snapshot Caveats,  Up: Snapshots
  269.  
  270. Making and Using Snapshots
  271. ..........................
  272.  
  273.    There are two basic commands for snapshots; one makes a snapshot
  274. with a given name, the other retrieves a named snapshot.
  275.  
  276. `C-x v s NAME RET'
  277.      Define the last saved versions of every registered file in or
  278.      under the current directory as a snapshot named NAME
  279.      (`vc-create-snapshot').
  280.  
  281. `C-x v r NAME RET'
  282.      Check out all registered files at or below the current directory
  283.      level using whatever versions correspond to the snapshot NAME
  284.      (`vc-retrieve-snapshot').
  285.  
  286.      This command reports an error if any files are locked at or below
  287.      the current directory, without changing anything; this is to avoid
  288.      overwriting work in progress.
  289.  
  290.    A snapshot uses a very small amount of resources--just enough to
  291. record the list of file names and which version belongs to the
  292. snapshot.  Thus, you need not hesitate to create snapshots whenever
  293. they are useful.
  294.  
  295.    You can give a snapshot name as an argument to `C-x v =' or `C-x v
  296. ~' (*note Old Versions::.).  Thus, you can use it to compare a snapshot
  297. against the current files, or two snapshots against each other, or a
  298. snapshot against a named version.
  299.  
  300. 
  301. File: emacs,  Node: Snapshot Caveats,  Prev: Making Snapshots,  Up: Snapshots
  302.  
  303. Snapshot Caveats
  304. ................
  305.  
  306.    VC's snapshot facilities are modeled on RCS's named-configuration
  307. support.  They use RCS's native facilities for this, so under VC
  308. snapshots made using RCS are visible even when you bypass VC.
  309.  
  310.    For SCCS, VC implements snapshots itself.  The files it uses contain
  311. name/file/version-number triples.  These snapshots are visible only
  312. through VC.
  313.  
  314.    A snapshot is a set of checked-in versions.  So make sure that all
  315. the files are checked in and not locked when you make a snapshot.
  316.  
  317.    File renaming and deletion can create some difficulties with
  318. snapshots.  This is not a VC-specific problem, but a general design
  319. issue in version control systems that no one has solved very well yet.
  320.  
  321.    If you rename a registered file, you need to rename its master along
  322. with it (the command `vc-rename-file' does this automatically).  If you
  323. are using SCCS, you must also update the records of the snapshot, to
  324. mention the file by its new name (`vc-rename-file' does this, too).  An
  325. old snapshot that refers to a master file that no longer exists under
  326. the recorded name is invalid; VC can no longer retrieve it.  It would
  327. be beyond the scope of this manual to explain enough about RCS and SCCS
  328. to explain how to update the snapshots by hand.
  329.  
  330.    Using `vc-rename-file' makes the snapshot remain valid for
  331. retrieval, but it does not solve all problems.  For example, some of the
  332. files in the program probably refer to others by name.  At the very
  333. least, the makefile probably mentions the file that you renamed.  If you
  334. retrieve an old snapshot, the renamed file is retrieved under its new
  335. name, which is not the name that the makefile expects.  So the program
  336. won't really work as retrieved.
  337.  
  338. 
  339. File: emacs,  Node: Version Headers,  Prev: Snapshots,  Up: Version Control
  340.  
  341. Inserting Version Control Headers
  342. ---------------------------------
  343.  
  344.    Sometimes it is convenient to put version identification strings
  345. directly into working files.  Certain special strings called "version
  346. headers" are replaced in each successive version by the number of that
  347. version.
  348.  
  349.    You can use the `C-x v h' command (`vc-insert-headers') to insert a
  350. suitable header string.
  351.  
  352. `C-x v h'
  353.      Insert headers in a file for use with your version-control system.
  354.  
  355.    The default header string is `$Id$' for RCS and `%W%' for SCCS.  You
  356. can specify other headers to insert by setting the variable
  357. `vc-header-alist'.  Its value is a list of elements of the form
  358. `(PROGRAM . STRING)' where PROGRAM is `RCS' or `SCCS' and STRING is the
  359. string to use.
  360.  
  361.    Instead of a single string, you can specify a list of strings; then
  362. each string in the list is inserted as a separate header on a line of
  363. its own.
  364.  
  365.    It is often necessary to use "superfluous" backslashes when writing
  366. the strings that you put in this variable.  This is to prevent the
  367. string in the constant from being interpreted as a header itself if the
  368. Emacs Lisp file containing it is maintained with version control.
  369.  
  370.    Each header is inserted surrounded by tabs, inside comment
  371. delimiters, on a new line at the start of the buffer.  Normally the
  372. ordinary comment start and comment end strings of the current mode are
  373. used, but for certain modes, there are special comment delimiters for
  374. this purpose; the variable `vc-comment-alist' specifies them.  Each
  375. element of this list has the form `(MODE STARTER ENDER)'.
  376.  
  377.    The variable `vc-static-header-alist' specifies further strings to
  378. add based on the name of the buffer.  Its value should be a list of
  379. elements of the form `(REGEXP . FORMAT)'.  Whenever REGEXP matches the
  380. buffer name, FORMAT is inserted as part of the header.  A header line
  381. is inserted for each element that matches the buffer name, and for each
  382. string specified by `vc-header-alist'.  The header line is made by
  383. processing the string from `vc-header-alist' with the format taken from
  384. the element.  The default value for `vc-static-header-alist' is as
  385. follows:
  386.  
  387.      (("\\.c$" .
  388.        "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
  389.      #endif /* lint */\n"))
  390.  
  391. It specifies insertion of text of this form:
  392.  
  393.  
  394.      #ifndef lint
  395.      static char vcid[] = "STRING";
  396.      #endif /* lint */
  397.  
  398. Note that the text above starts with a blank line.
  399.  
  400.    If you use more than one version header in a file, put them close
  401. together in the file.  The mechanism in `revert-buffer' that preserves
  402. markers may fail for markers positioned between two version headers.
  403.  
  404. 
  405. File: emacs,  Node: ListDir,  Next: Comparing Files,  Prev: Version Control,  Up: Files
  406.  
  407. Listing a File Directory
  408. ========================
  409.  
  410.    The file system groups files into "directories".  A "directory
  411. listing" is a list of all the files in a directory.  Emacs provides
  412. directory listings in brief format (file names only) and verbose format
  413. (sizes, dates, and authors included).  (There is also a directory
  414. browser called Dired; *Note Dired::.)
  415.  
  416. `C-x C-d DIR-OR-PATTERN'
  417.      Print a brief directory listing (`list-directory').
  418.  
  419. `C-u C-x C-d DIR-OR-PATTERN'
  420.      Print a verbose directory listing.
  421.  
  422.    The command to display a directory listing is `C-x C-d'
  423. (`list-directory').  It reads using the minibuffer a file name which is
  424. either a directory to be listed or a wildcard-containing pattern for
  425. the files to be listed.  For example,
  426.  
  427.      C-x C-d /u2/emacs/etc RET
  428.  
  429. lists all the files in directory `/u2/emacs/etc'.  Here is an example
  430. of specifying a file name pattern:
  431.  
  432.      C-x C-d /u2/emacs/src/*.c RET
  433.  
  434.    Normally, `C-x C-d' prints a brief directory listing containing just
  435. file names.  A numeric argument (regardless of value) tells it to print
  436. a verbose listing (like `ls -l').
  437.  
  438.    The text of a directory listing is obtained by running `ls' in an
  439. inferior process.  Two Emacs variables control the switches passed to
  440. `ls': `list-directory-brief-switches' is a string giving the switches
  441. to use in brief listings (`"-CF"' by default), and
  442. `list-directory-verbose-switches' is a string giving the switches to
  443. use in a verbose listing (`"-l"' by default).
  444.  
  445. 
  446. File: emacs,  Node: Comparing Files,  Next: Misc File Ops,  Prev: ListDir,  Up: Files
  447.  
  448. Comparing Files
  449. ===============
  450.  
  451.    The command `M-x diff' compares two files, displaying the
  452. differences in an Emacs buffer named `*Diff*'.  It works by running the
  453. `diff' program, using options taken from the variable `diff-switches',
  454. whose value should be a string.
  455.  
  456.    The buffer `*Diff*' has Compilation mode as its major mode, so you
  457. can use `C-x `' to visit successive changed locations in the two source
  458. files.  You can also move to a particular hunk of changes and type `C-c
  459. C-c', or click `Mouse-2' on it, to move to the corresponding source
  460. location.  You can also use the other special commands of Compilation
  461. mode: SPC and DEL for scrolling, and `M-p' and `M-n' for cursor motion.
  462. *Note Compilation::.
  463.  
  464.    The command `M-x diff-backup' compares a specified file with its most
  465. recent backup.  If you specify the name of a backup file, `diff-backup'
  466. compares it with the source file that it is a backup of.
  467.  
  468.    The command `M-x compare-windows' compares the text in the current
  469. window with that in the next window.  Comparison starts at point in each
  470. window.  Point moves forward in each window, a character at a time in
  471. each window, until the next characters in the two windows are
  472. different.  Then the command is finished.  For more information about
  473. windows in Emacs, *Note Windows::.
  474.  
  475.    With a numeric argument, `compare-windows' ignores changes in
  476. whitespace.  If the variable `compare-ignore-case' is non-`nil', it
  477. ignores differences in case as well.
  478.  
  479.    See also *Note Emerge::, for convenient facilities for merging two
  480. similar files.
  481.  
  482. 
  483. File: emacs,  Node: Misc File Ops,  Prev: Comparing Files,  Up: Files
  484.  
  485. Miscellaneous File Operations
  486. =============================
  487.  
  488.    Emacs has commands for performing many other operations on files.
  489. All operate on one file; they do not accept wild card file names.
  490.  
  491.    `M-x view-file' allows you to scan or read a file by sequential
  492. screenfuls.  It reads a file name argument using the minibuffer.  After
  493. reading the file into an Emacs buffer, `view-file' displays the
  494. beginning.  You can then type SPC to scroll forward one windowful, or
  495. DEL to scroll backward.  Various other commands are provided for moving
  496. around in the file, but none for changing it; type `C-h' while viewing
  497. for a list of them.  They are mostly the same as normal Emacs cursor
  498. motion commands.  To exit from viewing, type `C-c'.  The commands for
  499. viewing are defined by a special major mode called View mode.
  500.  
  501.    A related command, `M-x view-buffer', views a buffer already present
  502. in Emacs.  *Note Misc Buffer::.
  503.  
  504.    `M-x insert-file' inserts a copy of the contents of the specified
  505. file into the current buffer at point, leaving point unchanged before
  506. the contents and the mark after them.
  507.  
  508.    `M-x write-region' is the inverse of `M-x insert-file'; it copies
  509. the contents of the region into the specified file.  `M-x
  510. append-to-file' adds the text of the region to the end of the specified
  511. file.  *Note Accumulating Text::.
  512.  
  513.    `M-x delete-file' deletes the specified file, like the `rm' command
  514. in the shell.  If you are deleting many files in one directory, it may
  515. be more convenient to use Dired (*note Dired::.).
  516.  
  517.    `M-x rename-file' reads two file names OLD and NEW using the
  518. minibuffer, then renames file OLD as NEW.  If a file named NEW already
  519. exists, you must confirm with `yes' or renaming is not done; this is
  520. because renaming causes the old meaning of the name NEW to be lost.  If
  521. OLD and NEW are on different file systems, the file OLD is copied and
  522. deleted.
  523.  
  524.    The similar command `M-x add-name-to-file' is used to add an
  525. additional name to an existing file without removing its old name.  The
  526. new name must belong on the same file system that the file is on.
  527.  
  528.    `M-x copy-file' reads the file OLD and writes a new file named NEW
  529. with the same contents.  Confirmation is required if a file named NEW
  530. already exists, because copying has the consequence of overwriting the
  531. old contents of the file NEW.
  532.  
  533.    `M-x make-symbolic-link' reads two file names OLD and LINKNAME, then
  534. creates a symbolic link named LINKNAME and pointing at OLD.  The effect
  535. is that future attempts to open file LINKNAME will refer to whatever
  536. file is named OLD at the time the opening is done, or will get an error
  537. if the name OLD is not in use at that time.  This command does not
  538. expand the argument FILENAME, so that it allows you to specify a
  539. relative name as the target of the link.
  540.  
  541.    Confirmation is required when creating the link if LINKNAME is in
  542. use.  Note that not all systems support symbolic links.
  543.  
  544. 
  545. File: emacs,  Node: Buffers,  Next: Windows,  Prev: Files,  Up: Top
  546.  
  547. Using Multiple Buffers
  548. **********************
  549.  
  550.    The text you are editing in Emacs resides in an object called a
  551. "buffer".  Each time you visit a file, a buffer is created to hold the
  552. file's text.  Each time you invoke Dired, a buffer is created to hold
  553. the directory listing.  If you send a message with `C-x m', a buffer
  554. named `*mail*' is used to hold the text of the message.  When you ask
  555. for a command's documentation, that appears in a buffer called `*Help*'.
  556.  
  557.    At any time, one and only one buffer is "selected".  It is also
  558. called the "current buffer".  Often we say that a command operates on
  559. "the buffer" as if there were only one; but really this means that the
  560. command operates on the selected buffer (most commands do).
  561.  
  562.    When Emacs has multiple windows, each window has a chosen buffer
  563. which is displayed there, but at any time only one of the windows is
  564. selected and its chosen buffer is the selected buffer.  Each window's
  565. mode line displays the name of the buffer that the window is displaying
  566. (*note Windows::.).
  567.  
  568.    Each buffer has a name, which can be of any length, and you can
  569. select any buffer by giving its name.  Most buffers are made by
  570. visiting files, and their names are derived from the files' names.  But
  571. you can also create an empty buffer with any name you want.  A newly
  572. started Emacs has a buffer named `*scratch*' which can be used for
  573. evaluating Lisp expressions in Emacs.  The distinction between upper
  574. and lower case matters in buffer names.
  575.  
  576.    Each buffer records individually what file it is visiting, whether
  577. it is modified, and what major mode and minor modes are in effect in it
  578. (*note Major Modes::.).  Any Emacs variable can be made "local to" a
  579. particular buffer, meaning its value in that buffer can be different
  580. from the value in other buffers.  *Note Locals::.
  581.  
  582. * Menu:
  583.  
  584. * Select Buffer::      Creating a new buffer or reselecting an old one.
  585. * List Buffers::       Getting a list of buffers that exist.
  586. * Misc Buffer::           Renaming; changing read-onliness; copying text.
  587. * Kill Buffer::           Killing buffers you no longer need.
  588. * Several Buffers::    How to go through the list of all buffers
  589.              and operate variously on several of them.
  590.  
  591. 
  592. File: emacs,  Node: Select Buffer,  Next: List Buffers,  Up: Buffers
  593.  
  594. Creating and Selecting Buffers
  595. ==============================
  596.  
  597. `C-x b BUFFER RET'
  598.      Select or create a buffer named BUFFER (`switch-to-buffer').
  599.  
  600. `C-x 4 b BUFFER RET'
  601.      Similar, but select BUFFER in another window
  602.      (`switch-to-buffer-other-window').
  603.  
  604. `C-x 5 b BUFFER RET'
  605.      Similar, but select BUFFER in a separate frame
  606.      (`switch-to-buffer-other-frame').
  607.  
  608.    To select the buffer named BUFNAME, type `C-x b BUFNAME RET'.  This
  609. runs the command `switch-to-buffer' with argument BUFNAME.  You can use
  610. completion on an abbreviation for the buffer name you want (*note
  611. Completion::.).  An empty argument to `C-x b' specifies the most
  612. recently selected buffer that is not displayed in any window.
  613.  
  614.    Most buffers are created by visiting files, or by Emacs commands that
  615. want to display some text, but you can also create a buffer explicitly
  616. by typing `C-x b BUFNAME RET'.  This makes a new, empty buffer which is
  617. not visiting any file, and selects it for editing.  Such buffers are
  618. used for making notes to yourself.  If you try to save one, you are
  619. asked for the file name to use.  The new buffer's major mode is
  620. determined by the value of `default-major-mode' (*note Major Modes::.).
  621.  
  622.    Note that `C-x C-f', and any other command for visiting a file, can
  623. also be used to switch to an existing file-visiting buffer.  *Note
  624. Visiting::.
  625.  
  626. 
  627. File: emacs,  Node: List Buffers,  Next: Misc Buffer,  Prev: Select Buffer,  Up: Buffers
  628.  
  629. Listing Existing Buffers
  630. ========================
  631.  
  632. `C-x C-b'
  633.      List the existing buffers (`list-buffers').
  634.  
  635.    To print a list of all the buffers that exist, type `C-x C-b'.  Each
  636. line in the list shows one buffer's name, major mode and visited file.
  637. The buffers are listed in the order, most recently visited first.
  638.  
  639.    `*' at the beginning of a line indicates the buffer is "modified".
  640. If several buffers are modified, it may be time to save some with `C-x
  641. s' (*note Saving::.).  `%' indicates a read-only buffer.  `.' marks the
  642. selected buffer.  Here is an example of a buffer list:
  643.  
  644.       MR Buffer         Size  Mode           File
  645.       -- ------         ----  ----           ----
  646.      .*  emacs.tex      383402 Texinfo       /u2/emacs/man/emacs.tex
  647.          *Help*         1287  Fundamental
  648.          files.el       23076 Emacs-Lisp     /u2/emacs/lisp/files.el
  649.        % RMAIL          64042 RMAIL          /u/rms/RMAIL
  650.       *% man            747   Dired          /u2/emacs/man/
  651.          net.emacs      343885 Fundamental   /u/rms/net.emacs
  652.          fileio.c       27691 C              /u2/emacs/src/fileio.c
  653.          NEWS           67340 Text           /u2/emacs/etc/NEWS
  654.          *scratch*       0     Lisp Interaction
  655.  
  656. Note that the buffer `*Help*' was made by a help request; it is not
  657. visiting any file.  The buffer `man' was made by Dired on the directory
  658. `/u2/emacs/man/'.
  659.  
  660. 
  661. File: emacs,  Node: Misc Buffer,  Next: Kill Buffer,  Prev: List Buffers,  Up: Buffers
  662.  
  663. Miscellaneous Buffer Operations
  664. ===============================
  665.  
  666. `C-x C-q'
  667.      Toggle read-only status of buffer (`vc-toggle-read-only').
  668.  
  669. `M-x rename-buffer RET NAME RET'
  670.      Change the name of the current buffer.
  671.  
  672. `M-x rename-uniquely'
  673.      Rename the current buffer by adding `<NUMBER>' to the end.
  674.  
  675. `M-x view-buffer RET BUFFER RET'
  676.      Scroll through buffer BUFFER.
  677.  
  678.    A buffer can be "read-only", which means that commands to change its
  679. contents are not allowed.  The mode line indicates read-only buffers
  680. with `%%' or `%*' near the left margin.  Read-only buffers are usually
  681. made by subsystems such as Dired and Rmail that have special commands
  682. to operate on the text; also by visiting a file whose access control
  683. says you cannot write it.
  684.  
  685.    If you wish to make changes in a read-only buffer, use the command
  686. `C-x C-q' (`vc-toggle-read-only').  It makes a read-only buffer
  687. writable, and makes a writable buffer read-only.  In most cases, this
  688. works by setting the variable `buffer-read-only', which has a local
  689. value in each buffer and makes the buffer read-only if its value is
  690. non-`nil'.  If the file is maintained with version control, `C-x C-q'
  691. works through the version control system to change the read-only status
  692. of the file as well as the buffer.
  693.  
  694.    `M-x rename-buffer' changes the name of the current buffer.  Specify
  695. the new name as a minibuffer argument.  There is no default.  If you
  696. specify a name that is in use for some other buffer, an error happens
  697. and no renaming is done.
  698.  
  699.    `M-x rename-uniquely' renames the current buffer to a similar name
  700. with a numeric suffix added to make it both different and unique.  This
  701. command does not need an argument.  It is useful for creating multiple
  702. shell buffers: if you rename the `*Shell*' buffer, then do `M-x shell'
  703. again, it makes a new shell buffer named `*Shell*'; meanwhile, the old
  704. shell buffer continues to exist under its new name.  This method is
  705. also good for mail buffers, compilation buffers, and most Emacs
  706. features that create special buffers with particular names.
  707.  
  708.    `M-x view-buffer' is much like `M-x view-file' (*note Misc File
  709. Ops::.) except that it examines an already existing Emacs buffer.  View
  710. mode provides commands for scrolling through the buffer conveniently
  711. but not for changing it.  When you exit View mode, the value of point
  712. that resulted from your perusal remains in effect.
  713.  
  714.    The commands `M-x append-to-buffer' and `M-x insert-buffer' can be
  715. used to copy text from one buffer to another.  *Note Accumulating
  716. Text::.
  717.  
  718. 
  719. File: emacs,  Node: Kill Buffer,  Next: Several Buffers,  Prev: Misc Buffer,  Up: Buffers
  720.  
  721. Killing Buffers
  722. ===============
  723.  
  724.    If you continue an Emacs session for a while, you may accumulate a
  725. large number of buffers.  You may then find it convenient to "kill" the
  726. buffers you no longer need.  On most operating systems, killing a
  727. buffer releases its space back to the operating system so that other
  728. programs can use it.  Here are some commands for killing buffers:
  729.  
  730. `C-x k BUFNAME RET'
  731.      Kill buffer BUFNAME (`kill-buffer').
  732.  
  733. `M-x kill-some-buffers'
  734.      Offer to kill each buffer, one by one.
  735.  
  736.    `C-x k' (`kill-buffer') kills one buffer, whose name you specify in
  737. the minibuffer.  The default, used if you type just RET in the
  738. minibuffer, is to kill the current buffer.  If you kill the current
  739. buffer, another buffer is selected; one that has been selected recently
  740. but does not appear in any window now.  If you ask to kill a
  741. file-visiting buffer that is modified (has unsaved editing), then you
  742. must confirm with `yes' before the buffer is killed.
  743.  
  744.    The command `M-x kill-some-buffers' asks about each buffer, one by
  745. one.  An answer of `y' means to kill the buffer.  Killing the current
  746. buffer or a buffer containing unsaved changes selects a new buffer or
  747. asks for confirmation just like `kill-buffer'.
  748.  
  749.    The buffer menu feature (*note Several Buffers::.) is also convenient
  750. for killing various buffers.
  751.  
  752.    If you want to do something special every time a buffer is killed,
  753. you can add hook functions to the hook `kill-buffer-hook' (*note
  754. Hooks::.).
  755.  
  756. 
  757. File: emacs,  Node: Several Buffers,  Prev: Kill Buffer,  Up: Buffers
  758.  
  759. Operating on Several Buffers
  760. ============================
  761.  
  762.    The "buffer-menu" facility is like a "Dired for buffers"; it allows
  763. you to request operations on various Emacs buffers by editing an Emacs
  764. buffer containing a list of them.  You can save buffers, kill them
  765. (here called "deleting" them, for consistency with Dired), or display
  766. them.
  767.  
  768. `M-x buffer-menu'
  769.      Begin editing a buffer listing all Emacs buffers.
  770.  
  771.    The command `buffer-menu' writes a list of all Emacs buffers into
  772. the buffer `*Buffer List*', and selects that buffer in Buffer Menu
  773. mode.  The buffer is read-only, and can be changed only through the
  774. special commands described in this section.  The usual Emacs cursor
  775. motion commands can be used in the `*Buffer List*' buffer.  The
  776. following commands apply to the buffer described on the current line.
  777.  
  778. `d'
  779.      Request to delete (kill) the buffer, then move down.  The request
  780.      shows as a `D' on the line, before the buffer name.  Requested
  781.      deletions take place when you type the `x' command.
  782.  
  783. `C-d'
  784.      Like `d' but move up afterwards instead of down.
  785.  
  786. `s'
  787.      Request to save the buffer.  The request shows as an `S' on the
  788.      line.  Requested saves take place when you type the `x' command.
  789.      You may request both saving and deletion for the same buffer.
  790.  
  791. `x'
  792.      Perform previously requested deletions and saves.
  793.  
  794. `u'
  795.      Remove any request made for the current line, and move down.
  796.  
  797. `DEL'
  798.      Move to previous line and remove any request made for that line.
  799.  
  800.    The `d', `s' and `u' commands to add or remove flags also move down
  801. a line.  They accept a numeric argument as a repeat count.
  802.  
  803.    These commands operate immediately on the buffer listed on the
  804. current line:
  805.  
  806. `~'
  807.      Mark the buffer "unmodified".  The command `~' does this
  808.      immediately when you type it.
  809.  
  810. `%'
  811.      Toggle the buffer's read-only flag.  The command `%' does this
  812.      immediately when you type it.
  813.  
  814. `t'
  815.      Visit the buffer as a tags table.  *Note Select Tags Table::.
  816.  
  817.    There are also commands to select another buffer or buffers:
  818.  
  819. `q'
  820.      Quit the buffer menu--immediately display the most recent formerly
  821.      visible buffer in its place.
  822.  
  823. `f'
  824.      Immediately select this line's buffer in place of the `*Buffer
  825.      List*' buffer.
  826.  
  827. `o'
  828.      Immediately select this line's buffer in another window as if by
  829.      `C-x 4 b', leaving `*Buffer List*' visible.
  830.  
  831. `C-o'
  832.      Immediately display this line's buffer in another window, but don't
  833.      select the window.
  834.  
  835. `1'
  836.      Immediately select this line's buffer in a full-screen window.
  837.  
  838. `2'
  839.      Immediately set up two windows, with this line's buffer in one,
  840.      and the previously selected buffer (aside from the buffer `*Buffer
  841.      List*') in the other.
  842.  
  843. `m'
  844.      Mark this line's buffer to be displayed in another window if the
  845.      `q' command is used.  The request shows as a `>' at the beginning
  846.      of the line.  (A single buffer may not have both a delete request
  847.      and a display request.)
  848.  
  849. `v'
  850.      Immediately select this line's buffer, and also display in other
  851.      windows any buffers previously marked with the `m' command.  If
  852.      you have not marked any buffers, this command is equivalent to `1'.
  853.  
  854.    All that `buffer-menu' does directly is create and select a suitable
  855. buffer, and turn on Buffer Menu mode.  Everything else described above
  856. is implemented by the special commands provided in Buffer Menu mode.
  857. One consequence of this is that you can switch from the `*Buffer List*'
  858. buffer to another Emacs buffer, and edit there.  You can reselect the
  859. `buffer-menu' buffer later, to perform the operations already
  860. requested, or you can kill it, or pay no further attention to it.
  861.  
  862.    The only difference between `buffer-menu' and `list-buffers' is that
  863. `buffer-menu' selects the `*Buffer List*' buffer and `list-buffers'
  864. does not.  If you run `list-buffers' (that is, type `C-x C-b') and
  865. select the buffer list manually, you can use all of the commands
  866. described here.
  867.  
  868.    The buffer `*Buffer List*' is not updated automatically when buffers
  869. are created and killed; its contents are just text.  If you have
  870. created, deleted or renamed buffers, the way to update `*Buffer List*'
  871. to show what you have done is to type `g' (`revert-buffer') or repeat
  872. the `buffer-menu' command.
  873.  
  874. 
  875. File: emacs,  Node: Windows,  Next: Frames,  Prev: Buffers,  Up: Top
  876.  
  877. Multiple Windows
  878. ****************
  879.  
  880.    Emacs can split a frame into two or many windows.  Multiple windows
  881. can display parts of different buffers, or different parts of one
  882. buffer.  Multiple frames always imply multiple windows, because each
  883. frame has its own set of windows.  Each window belongs to one and only
  884. one frame.
  885.  
  886. * Menu:
  887.  
  888. * Basic Window::       Introduction to Emacs windows.
  889. * Split Window::       New windows are made by splitting existing windows.
  890. * Other Window::       Moving to another window or doing something to it.
  891. * Pop Up Window::      Finding a file or buffer in another window.
  892. * Change Window::      Deleting windows and changing their sizes.
  893.  
  894. 
  895. File: emacs,  Node: Basic Window,  Next: Split Window,  Up: Windows
  896.  
  897. Concepts of Emacs Windows
  898. =========================
  899.  
  900.    Each Emacs window displays one Emacs buffer at any time.  A single
  901. buffer may appear in more than one window; if it does, any changes in
  902. its text are displayed in all the windows where it appears.  But the
  903. windows showing the same buffer can show different parts of it, because
  904. each window has its own value of point.
  905.  
  906.    At any time, one of the windows is the "selected window"; the buffer
  907. this window is displaying is the current buffer.  The terminal's cursor
  908. shows the location of point in this window.  Each other window has a
  909. location of point as well, but since the terminal has only one cursor
  910. there is no way to show where those locations are.  When you make
  911. multiple frames, each frame has a cursor which appears in the frame's
  912. selected window.  The cursor in the selected frame is solid; the cursor
  913. in other frames is a hollow box.
  914.  
  915.    Commands to move point affect the value of point for the selected
  916. Emacs window only.  They do not change the value of point in any other
  917. Emacs window, even one showing the same buffer.  The same is true for
  918. commands such as `C-x b' to change the selected buffer in the selected
  919. window; they do not affect other windows at all.  However, there are
  920. other commands such as `C-x 4 b' that select a different window and
  921. switch buffers in it.  Also, all commands that display information in a
  922. window, including (for example) `C-h f' (`describe-function') and `C-x
  923. C-b' (`list-buffers'), work by switching buffers in a nonselected window
  924. without affecting the selected window.
  925.  
  926.    When multiple windows show the same buffer, they can have different
  927. regions, because they can have different values of point.  This means
  928. that in Transient Mark mode, each window highlights a different part of
  929. the buffer.  The part that is highlighted in the selected window is the
  930. region that editing commands use.
  931.  
  932.    Each window has its own mode line, which displays the buffer name,
  933. modification status and major and minor modes of the buffer that is
  934. displayed in the window.  *Note Mode Line::, for full details on the
  935. mode line.
  936.  
  937. 
  938. File: emacs,  Node: Split Window,  Next: Other Window,  Prev: Basic Window,  Up: Windows
  939.  
  940. Splitting Windows
  941. =================
  942.  
  943. `C-x 2'
  944.      Split the selected window into two windows, one above the other
  945.      (`split-window-vertically').
  946.  
  947. `C-x 3'
  948.      Split the selected window into two windows positioned side by side
  949.      (`split-window-horizontally').
  950.  
  951. `C-Mouse-2'
  952.      In the mode line or scroll bar of a window, split that window.
  953.  
  954.    The command `C-x 2' (`split-window-vertically') breaks the selected
  955. window into two windows, one above the other.  Both windows start out
  956. displaying the same buffer, with the same value of point.  By default
  957. the two windows each get half the height of the window that was split; a
  958. numeric argument specifies how many lines to give to the top window.
  959.  
  960.    `C-x 3' (`split-window-horizontally') breaks the selected window
  961. into two side-by-side windows.  A numeric argument specifies how many
  962. columns to give the one on the left.  A line of vertical bars separates
  963. the two windows.  Windows that are not the full width of the screen
  964. have mode lines, but they are truncated; also, they do not always
  965. appear in inverse video, because the Emacs display routines have not
  966. been taught how to display a region of inverse video that is only part
  967. of a line on the screen.
  968.  
  969.    You can split a window horizontally or vertically by clicking
  970. `C-Mouse-2' in the mode line or the scroll bar.  The line of splitting
  971. goes through the place where you click: if you click on the mode line,
  972. the new scroll bar goes above the spot; if you click in the scroll bar,
  973. the mode line of the split window is side by side with your click.
  974.  
  975.    When a window is less than the full width, text lines too long to
  976. fit are frequent.  Continuing all those lines might be confusing.  The
  977. variable `truncate-partial-width-windows' can be set non-`nil' to force
  978. truncation in all windows less than the full width of the screen,
  979. independent of the buffer being displayed and its value for
  980. `truncate-lines'.  *Note Continuation Lines::.
  981.  
  982.    Horizontal scrolling is often used in side-by-side windows.  *Note
  983. Display::.
  984.  
  985.    If `split-window-keep-point' is non-nil, `C-x 2' tries to avoid
  986. shifting any text on the screen by putting point in whichever window
  987. happens to contain the screen line the cursor is already on.  The
  988. default is that `split-window-keep-point' is non-nil on slow terminals.
  989.  
  990. 
  991. File: emacs,  Node: Other Window,  Next: Pop Up Window,  Prev: Split Window,  Up: Windows
  992.  
  993. Using Other Windows
  994. ===================
  995.  
  996. `C-x o'
  997.      Select another window (`other-window').  That is `o', not zero.
  998.  
  999. `C-M-v'
  1000.      Scroll the next window (`scroll-other-window').
  1001.  
  1002. `M-x compare-windows'
  1003.      Find next place where the text in the selected window does not
  1004.      match the text in the next window.
  1005.  
  1006. `Mouse-1'
  1007.      `Mouse-1', in a window's mode line, selects that window but does
  1008.      not move point in it (`mouse-select-region').
  1009.  
  1010.    To select a different window, click with `Mouse-1' on its mode line.
  1011. With the keyboard, you can switch windows by typing `C-x o'
  1012. (`other-window').  That is an `o', for `other', not a zero.  When there
  1013. are more than two windows, this command moves through all the windows
  1014. in a cyclic order, generally top to bottom and left to right.  After
  1015. the rightmost and bottommost window, it goes back to the one at the
  1016. upper left corner.  A numeric argument means to move several steps in
  1017. the cyclic order of windows.  A negative argument moves around the
  1018. cycle in the opposite order.  When the minibuffer is active, the
  1019. minibuffer is the last window in the cycle; you can switch from the
  1020. minibuffer window to one of the other windows, and later switch back and
  1021. finish supplying the minibuffer argument that is requested.  *Note
  1022. Minibuffer Edit::.
  1023.  
  1024.    The usual scrolling commands (*note Display::.) apply to the selected
  1025. window only, but there is one command to scroll the next window.
  1026. `C-M-v' (`scroll-other-window') scrolls the window that `C-x o' would
  1027. select.  It takes arguments, positive and negative, like `C-v'.  (In
  1028. the minibuffer, `C-M-v' scrolls the window that contains the minibuffer
  1029. help display, if any, rather than the next window in the standard
  1030. cyclic order.)
  1031.  
  1032.    The command `M-x compare-windows' lets you compare two files or
  1033. buffers visible in two windows, by moving through them to the next
  1034. mismatch.  *Note Comparing Files::, for details.
  1035.  
  1036. 
  1037. File: emacs,  Node: Pop Up Window,  Next: Change Window,  Prev: Other Window,  Up: Windows
  1038.  
  1039. Displaying in Another Window
  1040. ============================
  1041.  
  1042.    `C-x 4' is a prefix key for commands that select another window
  1043. (splitting the window if there is only one) and select a buffer in that
  1044. window.  Different `C-x 4' commands have different ways of finding the
  1045. buffer to select.
  1046.  
  1047. `C-x 4 b BUFNAME RET'
  1048.      Select buffer BUFNAME in another window.  This runs
  1049.      `switch-to-buffer-other-window'.
  1050.  
  1051. `C-x 4 C-o BUFNAME RET'
  1052.      Display buffer BUFNAME in another window, but don't select that
  1053.      buffer or that window.  This runs `display-buffer'.
  1054.  
  1055. `C-x 4 f FILENAME RET'
  1056.      Visit file FILENAME and select its buffer in another window.  This
  1057.      runs `find-file-other-window'.  *Note Visiting::.
  1058.  
  1059. `C-x 4 d DIRECTORY RET'
  1060.      Select a Dired buffer for directory DIRECTORY in another window.
  1061.      This runs `dired-other-window'.  *Note Dired::.
  1062.  
  1063. `C-x 4 m'
  1064.      Start composing a mail message in another window.  This runs
  1065.      `mail-other-window'; its same-window analogue is `C-x m' (*note
  1066.      Sending Mail::.).
  1067.  
  1068. `C-x 4 .'
  1069.      Find a tag in the current tags table, in another window.  This runs
  1070.      `find-tag-other-window', the multiple-window variant of `M-.'
  1071.      (*note Tags::.).
  1072.  
  1073. `C-x 4 r FILENAME RET'
  1074.      Visit file FILENAME read-only, and select its buffer in another
  1075.      window.  This runs `find-file-read-only-other-window'.  *Note
  1076.      Visiting::.
  1077.  
  1078. 
  1079. File: emacs,  Node: Change Window,  Prev: Pop Up Window,  Up: Windows
  1080.  
  1081. Deleting and Rearranging Windows
  1082. ================================
  1083.  
  1084. `C-x 0'
  1085.      Delete the selected window (`delete-window').  That is a zero.
  1086.  
  1087. `C-x 1'
  1088.      Delete all windows in the selected frame except the selected window
  1089.      (`delete-other-windows').
  1090.  
  1091. `C-x ^'
  1092.      Make selected window taller (`enlarge-window').
  1093.  
  1094. `C-x }'
  1095.      Make selected window wider (`enlarge-window-horizontally').
  1096.  
  1097. `Mouse-2'
  1098.      `Mouse-2' in a window's mode line deletes all other windows in the
  1099.      frame (`mouse-delete-other-windows').
  1100.  
  1101. `Mouse-3'
  1102.      `Mouse-3' in a window's mode line deletes that window
  1103.      (`mouse-delete-window').
  1104.  
  1105.    To delete a window, type `C-x 0' (`delete-window').  (That is a
  1106. zero.)  The space occupied by the deleted window is given to an
  1107. adjacent window (but not the minibuffer window, even if that is active
  1108. at the time).  Once a window is deleted, its attributes are forgotten;
  1109. only restoring a window configuration can bring it back.  Deleting the
  1110. window has no effect on the buffer it used to display; the buffer
  1111. continues to exist, and you can select it in any window with `C-x b'.
  1112.  
  1113.    `C-x 1' (`delete-other-windows') is more powerful than `C-x 0'; it
  1114. deletes all the windows except the selected one (and the minibuffer);
  1115. the selected window expands to use the whole frame except for the echo
  1116. area.
  1117.  
  1118.    You can also delete a window by clicking on its mode line with
  1119. `Mouse-2', and expand a window to full screen by clicking on its mode
  1120. line with `Mouse-3'.
  1121.  
  1122.    To readjust the division of space among vertically adjacent windows,
  1123. use `C-x ^' (`enlarge-window').  It makes the currently selected window
  1124. get one line bigger, or as many lines as is specified with a numeric
  1125. argument.  With a negative argument, it makes the selected window
  1126. smaller.  `C-x }' (`enlarge-window-horizontally') makes the selected
  1127. window wider by the specified number of columns.  The extra screen
  1128. space given to a window comes from one of its neighbors, if that is
  1129. possible.  If this makes any window too small, it is deleted and its
  1130. space is given to an adjacent window.  The minimum size is specified by
  1131. the variables `window-min-height' and `window-min-width'.
  1132.  
  1133.    *Note Minibuffer Edit::, for information about the Resize-Minibuffer
  1134. mode, which automatically changes the size of the minibuffer window to
  1135. fit the text in the minibuffer.
  1136.  
  1137.